/*
 * @Author: lxy
 * @Date: 2021-12-01 10:52:38
 * @LastEditTime: 2022-01-11 15:13:26
 * @Description: 
 * @FilePath: /vue2-project/config/index.js
 */
'use strict'

const path = require('path')

module.exports = {
	dev: {
		// Paths
		assetsSubDirectory: 'static',
		assetsPublicPath: '/',
		proxyTable: {
			'/api': {
				// target: 'http://yzq.sh1.k9s.run:2271',
				target: 'http://jky.sh1.k9s.run:2271',
				// target: 'https://crxsukrt1h5k.ngrok2.xiaomiqiu.cn',
				secure: false,
				changeOrigin: true,
				pathRewrite: {
					'^/api': '',
				},
			},
		},
		openBrowser: true,
		// Various Dev Server settings
		host: '0.0.0.0', // can be overwritten by process.env.HOST
		port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
		// autoOpenBrowser: true,
		errorOverlay: true,
		notifyOnErrors: true,
		poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
		useEslint: false,
		// If true, eslint errors and warnings will also be shown in the error overlay
		// in the browser.
		showEslintErrorsInOverlay: false,

		/**
		 * Source Maps
		 */

		// https://webpack.js.org/configuration/devtool/#development
		devtool: 'eval-cheap-module-source-map',
		// devtool: 'source-map',

		// If you have problems debugging vue-files in devtools,
		// set this to false - it *may* help
		// https://vue-loader.vuejs.org/en/options.html#cachebusting
		// cacheBusting: true,

		cssSourceMap: true,
	},

	build: {
		// Template for index.html
		index: path.resolve(__dirname, '../dist/index.html'),

		// Paths
		assetsRoot: path.resolve(__dirname, '../dist'),
		assetsSubDirectory: 'static',
		assetsPublicPath: '/',

		/**
		 * Source Maps
		 */

		productionSourceMap: false,
		// https://webpack.js.org/configuration/devtool/#production
		devtool: '#source-map',
		productionGzip: true,
		productionGzipExtensions: ['js', 'css'],
		bundleAnalyzerReport: process.env.npm_config_report,
	},
}
